package com.syeet.gulimall.product.vo;

import com.syeet.gulimall.product.entity.SkuImagesEntity;
import com.syeet.gulimall.product.entity.SkuInfoEntity;
import com.syeet.gulimall.product.entity.SpuInfoDescEntity;
import lombok.Data;
import lombok.ToString;

import java.util.List;

/**
 * item.html 商品详情页信息
 * @author xhl
 * @date 2022/7/21
 */
@Data
public class SkuItemVo {
    //1 sku基本信息 pms_sku_info
    SkuInfoEntity info;

    //是否有货
    boolean hasStock = true;

    //2. sku图片信息 pms_sku_images
    List<SkuImagesEntity> images;

    //3 获取spu销售属性组合
    List<SkuItemSaleAttrVO> saleAttr;

    //4 spu介绍
    SpuInfoDescEntity desp;

    //5 spu规格参数信息(就是规格与包装栏)
    List<SpuItemAttrGroupVO> groupAttrs;

    @ToString
    @Data
    public static class SkuItemSaleAttrVO {
        private Long attrId;
        private String attrName;
        private List<AttrValueWithSkuIdVo> attrValues;
    }

    @ToString
    @Data
    public static class SpuItemAttrGroupVO {
        private String groupName;
        private List<SpuBaseAttrVO> attrs;

    }

    @ToString
    @Data
    public static class SpuBaseAttrVO {
        private String attrName;
        private String attrValue;
    }

}
